---
title: ChangeUserPassword
summary: Resets an external-domain account's password, absorbing failures into a sentinel response.
status: draft
owner: "Not determined from source"
last_reviewed: 2026-09-22
---

# ChangeUserPassword (OP-10)

## Request and response

| Part | Type | Description |
| --- | --- | --- |
| `inUserId` | `String` | The `SamAccountName` of the account whose password is reset. |
| `inNewPassword` | `String` | The new password, carried as a plaintext SOAP string parameter (SEC-06 — see [Authentication and authorization](../authentication-authorization.md)). Never reproduce example values in documentation; use `<value>` placeholders only. |

| Part | Type | Description |
| --- | --- | --- |
| `<return>` | `ADServiceResponse` | `Response` is `Success`, `UserDoesNotExist`, or `Failure`. `Message` carries the caught exception text on a `Failure`, otherwise empty. |

## WebMethod attributes

`<WebMethod()>` — bare, no arguments supplied.

## Steps

1. `CheckAccess()`; on denial return `AccessDenied()` ([BR-01](../business-rules.md#br-01-mutating-and-password-operations-require-an-approved-caller)).
2. Initialize the response sentinel to `Success`.
3. Open `Try`; call the private helper H6 `ChangePassword(inUserId, inNewPassword)` and assign its `EResponse` result to `Response` ([BR-25](../business-rules.md#br-25-a-password-change-is-applied-via-setpassword-and-committed)).
   - H6 selects the external domain via H1, resolves the user with `UserPrincipal.FindByIdentity` directly (returning `UserDoesNotExist` when `Nothing`), and otherwise invokes `SetPassword` on the underlying `DirectoryEntry` (late-bound) followed by `CommitChanges()`. H6 itself contains **no** `Catch` — every failure inside it propagates to this operation's own `Try`.
4. `Catch ex As Exception` → set `Response = Failure`, `Message = ex.Message` ([BR-26](../business-rules.md#br-26-two-password-change-variants-differ-only-in-error-strategy)).
5. Return the response sentinel.

## Process flow

```mermaid
flowchart TD
    A["Call ChangeUserPassword"] --> B{"CheckAccess<br>HasAccess?"}
    B -->|"No"| C["Return AccessDenied"]
    B -->|"Yes"| D["Try: call H6 ChangePassword"]
    D --> E["H6: FindByIdentity<br>external domain"]
    E -->|"Nothing"| F["H6 returns UserDoesNotExist"]
    E -->|"Found"| G["H6: SetPassword + CommitChanges"]
    F --> H["Assign Response<br>from H6 result"]
    G --> H
    H --> I["Return response"]
    D -.->|"Any exception<br>from H6 or context"| J["Catch: Set Failure + ex.Message"]
    J --> I
```

## Shared state effects

None — this operation touches no process-wide state; all locals are per-request.

## Error handling

The operation never surfaces a framework SOAP fault: a rejected password (policy, history, complexity) or any other directory failure inside H6 is caught here and flattened into `Response = Failure` with the raw .NET exception text in `Message`. Compare with [ChangeUserPasswordOrGetException](change-user-password-or-get-exception.md), which invokes the same helper with no exception handling. See [Faults](../faults.md) for the service-wide fault model.

## Authorization

Gated by [BR-01](../business-rules.md#br-01-mutating-and-password-operations-require-an-approved-caller): the caller must pass the IP allow-list check enforced by `CheckAccess`. See [Authentication and authorization](../authentication-authorization.md).

## Related documentation
- [Service index](../index.md)
- [Overview](../overview.md)
- [Architecture](../architecture.md)
- [Activation and hosting](../activation-hosting.md)
- [Operations](../operations.md)
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [Authentication and authorization](../authentication-authorization.md)
- [Configuration](../configuration.md)
- [Dependencies](../dependencies.md)
- [Faults](../faults.md)
- [Operational runbook](../operational-runbook.md)
- [Tech debt](../tech-debt.md)

## Sources
- `src\ADUserServices\clsADUserServices.asmx.vb` (lines 471-491, helper `ChangePassword` lines 503-524)
